﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MicropleSoft.WmsServiceLibrary.Domain;

namespace MicropleSoft.Web
{
    public partial class ServiceFacade
    {
        #region LocationManage

        public List<Area> GetAreaList(string condition)
        {
            return this.CreateAbstractServiceFactory().CreateAreaService().Query(condition);
        }


        public void SaveAreas(List<Area> areas)
        {
            this.CreateAbstractServiceFactory().CreateAreaService().Save(areas.ToList<IArea>());
        }

        public void SaveAreas(List<Area> areas, List<String> notUpdateProperties)
        {
            this.CreateAbstractServiceFactory().CreateAreaService().Save(areas.ToList<IArea>(), notUpdateProperties);
        }

        public List<AreaDetail> GetAreaDetailList(string condition)
        {
            return this.CreateAbstractServiceFactory().CreateAreaDetailService().Query(condition);
        }


        public void SaveAreaDetails(List<AreaDetail> areaDetails)
        {
            this.CreateAbstractServiceFactory().CreateAreaDetailService().Save(areaDetails.ToList<IAreaDetail>());
        }

        public void SaveAreaDetails(List<AreaDetail> areaDetails, List<String> notUpdateProperties)
        {
            this.CreateAbstractServiceFactory().CreateAreaDetailService().Save(areaDetails.ToList<IAreaDetail>(), notUpdateProperties);
        }

        public List<Location> GetLocationList(string condition)
        {
            return this.CreateAbstractServiceFactory().CreateLocationService().Query(condition);
        }


        public void SaveLocations(List<Location> locations)
        {
            this.CreateAbstractServiceFactory().CreateLocationService().Save(locations.ToList<ILocation>());
        }

        public void SaveLocations(List<Location> locations, List<String> notUpdateProperties)
        {
            this.CreateAbstractServiceFactory().CreateLocationService().Save(locations.ToList<ILocation>(), notUpdateProperties);
        }

        public List<LocationTemplate> GetLocationTemplateList(string condition)
        {
            return this.CreateAbstractServiceFactory().CreateLocationTemplateService().Query(condition);
        }


        public void SaveLocationTemplates(List<LocationTemplate> locationTemplates)
        {
            this.CreateAbstractServiceFactory().CreateLocationTemplateService().Save(locationTemplates.ToList<ILocationTemplate>());
        }

        public void SaveLocationTemplates(List<LocationTemplate> locationTemplates, List<String> notUpdateProperties)
        {
            this.CreateAbstractServiceFactory().CreateLocationTemplateService().Save(locationTemplates.ToList<ILocationTemplate>(), notUpdateProperties);
        }

        public List<Zone> GetZoneList(string condition)
        {
            return this.CreateAbstractServiceFactory().CreateZoneService().Query(condition);
        }


        public void SaveZones(List<Zone> zones)
        {
            this.CreateAbstractServiceFactory().CreateZoneService().Save(zones.ToList<IZone>());
        }

        public void SaveZones(List<Zone> zones, List<String> notUpdateProperties)
        {
            this.CreateAbstractServiceFactory().CreateZoneService().Save(zones.ToList<IZone>(), notUpdateProperties);
        }

        #endregion
    }
}